<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-订单入库</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<script language="javascript" type="text/javascript" src="js/js.js"></script>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/dialog/lhgdialog.js?skin=default"></script>
<script type="text/javascript">
	function queryOrder(){
		//alert($("#orderId").val());
		if($("#orderId").val()!=""){
			var id=$("#orderId").val();
			alert(id);			
			$.ajax({
				url:"repertory/queryStockInOrder.action",
				type:"POST",
				data:"orderid=" + id,
				dataType:"html",
				success:function(){
					alert("OK");
					window.location.reload();
				}
			});
		}
	}
	$(document).ready(function(){
		if($("#errorMessage").val() == "norecord"){
			showTip("查无此条记录，请重新输入订单号码");
		}else if($("#errorMessage").val() == "success"){
			showTip("入库成功");
		}else if ($("#errorMessage").val() == "duplicate_stockin") {
			showTip("重复入库");
		}
	});
	function queryCheck(){
		var pattern = new RegExp(/^[0-9-+]+$/);//^表示开始 $表示结束 右方括号（])后跟+号，意味着这个模式可以重复一次或多次
        var orderid = $("#orderId").val();
        if($.trim(orderid).length != 12){
        	showTip("请输入12位数字订单号码");
        	return;
        }else if(!pattern.test(orderid)){
        	showTip("您输入的号码中含有非数字字符，请重新输入");
        	return;
        }
        $("#queryOrder").submit();
	}
	function showTip(alertMessage){
		$.dialog({
			title: "提示",
		    time: 5,
		    lock: true,
		    content: alertMessage,
		    width: 160,
	    	height: 80
		});
	}
</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt">
    	<div class="topleft fl">系统菜单栏</div></td>
    <td bgcolor="#e7e7e7" class=" bbt">
    	<div class="topleft fl">您现在的位置：<a href="#">首页</a>&nbsp;>&nbsp;<span>订单入库</span></div>
    </td>
  </tr>
  <tr>
    <td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt">
    <div class="left_bk"> 
        <div class="menu2">
         <%@include file="repertory_left.jsp" %>
        </div>
    </div></td>
    <td align="left" valign="top" bgcolor="#FFFFFF">
    <div class="content" >
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;">
	          <div class="tt_back fl">入库订单</div>
	          <div class="fr">
	          	<img src="images/tit_right.jpg" alt="" width="103" height="38" />
	          </div>
          </td>
        </tr>        
        <tr>
			<td class="borders btn">
		    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		    		<tr>
		        	<td bgcolor="#fffeee" height="41" style="border-bottom:#fee7bd solid 1px;" align="center">
		        		<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
		        			<tr class="captitle">
				            <td height="31" colspan="6"  valign="middle" style="padding-left: 20px;font-weight: bold;">
								当前仓库
				            </td>
				            </tr>
				          <tr height="26" bgcolor="#efefef" class="captit">
				          	<td width="13%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">仓库编号</td>
				            <td width="16%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">仓库名称</td>
				            <td width="11%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">仓库类型</td>
				            <td width="28%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">仓库所在位置</td>
				            <td width="11%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">仓库管理员</td>
				            <td width="21%" height="26" align="center" valign="middle" bgcolor="#FFFFFF">备注信息</td>
				          </tr>
				          <s:iterator value="warehouseList" id="item">
				          	<tr height="26" bgcolor="#efefef">
				          		<td align="center" valign="middle"><s:property value="#item.id"/></td>
				          		<td align="center" valign="middle"><s:property value="#item.warehouse"/></td>
				          		<td align="center" valign="middle"><s:property value="#item.waretype"/></td>
				          		<td align="center" valign="middle"><s:property value="#item.whlocation"/></td>
				          		<td align="center" valign="middle"><s:property value="#item.whkeeper"/></td>
				          		<td align="center" valign="middle"><s:property value="#item.remark"/></td>
				          	</tr>
				          </s:iterator>
		        		</table>
		        	</td>
		        </tr>		    	
				  <tr>
				    <td bgcolor="#fffeee" height="41" style="border-bottom:#fee7bd solid 1px;" align="center">
				    <div style="height:450px">
				    <table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
				    	<tr>
						    <td height="41" bgcolor="#fffeee" style="border-bottom:#fee7bd solid 1px;padding-left: 20px;">
						    <form action="repertory/queryStockInOrder.action" id="queryOrder" method="post">	
						    	<s:hidden name="errorMessage" id="errorMessage"/>	
							    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="left">
								    <tr>
								    <td width="10%" align="right">订单号：</td>
								    <td width="20%" align="left">
								    	<input type="text" id="orderId" name="orderid" onblur="queryCheck()"						    		
								    		style="width: 200px;" class="input_are w122" />
								    </td>
								  	</tr>
							  	</table>
							</form>
							</td>
					  	</tr>
					  	<tr>
					  		<td>
					  			<div style="height:400px;overflow-y: scroll;overflow-x: auto;">
					  			<s:if test="order.id != null">
					  			<table id="stockInOrderInfo" width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
					  				<tr class="captitle">
							            <td height="31" colspan="6"  valign="middle" style="padding-left: 20px;font-weight: bold;">
											订单信息
							            </td>
							        </tr>
					  				<tr style="height: 30px;" bgcolor="#efefef">
										<td align="right" width="10%">订单号：</td>
										<td width="30%" align="left" valign="middle">
											<input type="text" class="input_are" id="orderid" name="order.id" value="${order.id}" readonly />
										</td>
									    <td align="right" width="10%">寄件日期：</td>
										<td width="50%" align="left" valign="middle">				  				
											<input type="text" id="senddate" name="order.senddate" value="<s:date name="order.senddate" format="yyyy-MM-dd" />" 
												class="input_are" readonly/>
										</td>
									</tr>
									<tr style="height: 30px;" bgcolor="#efefef">
										<td align="right" width="10%">寄件人姓名：</td>
										<td width="30%"  align="left" valign="middle">
											<input type="text" id="sender" class="input_are" name="order.sender" value="${order.sender}" readonly/></td>
									    <td align="right" width="10%">收件人姓名：</td>
										<td width="50%" align="left" valign="middle">
											<input type="text" id="recipient" class="input_are" name="order.recipient" value="${order.recipient}" readonly/></td>
									</tr>
									<tr style="height: 30px;" bgcolor="#efefef">
										<td align="right" width="10%">寄件人公司：</td>
										<td width="30%" align="left" valign="middle">
											<input type="text" id="senderfirm" class="input_are" name="order.senderfirm" value="${order.senderfirm}" readonly/></td>
									    <td align="right" width="10%">收件人公司：</td>
										<td width="50%" align="left" valign="middle">
											<input type="text"  id="recipientfirm" class="input_are" name="order.recipientfirm" value="${order.recipientfirm}" readonly/></td>
									</tr>
									<tr style="height: 30px;" bgcolor="#efefef">
										<td align="right" width="10%">寄件人电话：</td>
										<td width="30%" align="left" valign="middle">
											<input type="text" id="sendertel" class="input_are" name="order.sendertel" value="${order.sendertel}" readonly/></td>
									    <td align="right" width="10%">收件人电话：</td>
										<td width="50%" align="left" valign="middle">
											<input type="text" id="recipienttel" class="input_are" name="order.recipienttel" value="${order.recipienttel}" readonly/></td>
									</tr>
									<tr style="height: 30px;" bgcolor="#efefef">
										<td align="right" width="10%">寄件人地址：</td>
										<td width="30%" align="left" valign="middle" >												  
											<input type="text" style="width:350px" id="senderaddr" class="input_are" name="order.senderaddr" 
												value="${order.senderaddr}" readonly/>						
										</td>				
										<td align="right" width="10%">收件人地址：</td>
										<td width="50%" align="left" valign="middle" >
											<input type="text" style="width:350px" id="recipientaddr" class="input_are" name="order.recipientaddr" value="${order.recipientaddr}" 
												readonly/></td>
									</tr>
									<tr style="height: 30px;" bgcolor="#efefef">
										<td align="right" width="10%">原寄地：</td>
										<td width="30%" align="left" valign="middle">
											<input type="text" id="origin" class="input_are" name="order.origin" value="${order.origin}" readonly/></td>
									    <td align="right" width="10%">目的地：</td>
										<td width="50%" align="left" valign="middle">
											<input type="text" id="destination" class="input_are" name="order.destination" value="${order.destination}" readonly/></td>
									</tr>
									<tr style="height: 30px" bgcolor="#efefef">
										<td align="right" width="10%">规格：</td>
										<td colspan="3" align="left" valign="middle" width="90%">
											数量
											<input type="text" style="width: 60px;" id="quantity" class="input_are" name="order.quantity" value="${order.quantity}" />&nbsp;&nbsp;&nbsp;&nbsp;
											重量
											<input type="text" style="width: 60px;" id="weight" class="input_are" name="order.weight" value="${order.weight}" />kg&nbsp;&nbsp;&nbsp;&nbsp;
											长
											<input type="text" style="width: 60px;" id="length" class="input_are" name="order.length" value="${order.length}" />m&nbsp;&nbsp;&nbsp;&nbsp;
											宽
											<input type="text" style="width: 60px;" id="width" class="input_are" name="order.width" value="${order.width}" />m&nbsp;&nbsp;&nbsp;&nbsp;
											高
											<input type="text" style="width: 60px;" id="height" class="input_are" name="order.height" value="${order.height}" />m&nbsp;&nbsp;
										</td>
									</tr>									
									<tr style="height: 30px;" bgcolor="#efefef">
										<td align="right" width="10%">费用：</td>
										<td width="30%" align="left" valign="middle">				  				
											<input type="text" id="cost" class="input_are"  name="order.cost" value="${order.cost}"/>
										</td>
										<td align="right" width="10%">收件员：</td>
										<td width="50%" align="left" valign="middle">				  				
											<input type="text" id="receiver" class="input_are"  name="order.receiver" value="${order.receiver}"/>
										</td>			  			
									</tr>
									<tr style="height: 30px;" bgcolor="#efefef">											
										<td align="right" width="10%">备注：</td>
										<td width="90%" align="left" valign="middle" colspan="3">				  				
											<input type="text" style="width:350px" id="remark" class="input_are"  name="order.remark" value="${order.remark}"/>
										</td>			  			
									</tr>
									<tr class="captitle">
							            <td height="31" colspan="6"  valign="middle" style="padding-left: 20px;font-weight: bold;">
											入库信息
							            </td>
							        </tr>
									
							        <tr style="height: 30px;" bgcolor="#efefef">							           
							            <td height="26" align="right" valign="middle" >入库时间</td>
							          	<td align="left" valign="middle">
							          		<input type="text" class="input_are" 
							          			value="<s:date name="inventoryinfo.registerdate" format="yyyy-MM-dd HH:mm:ss" />" readonly/>
							          	</td>
							          	<td align="right" >备注：</td>
										<td align="left" valign="middle" >				  				
											<input type="text" style="width:350px" class="input_are"  value="${inventoryinfo.remark}"/>
										</td>			  
							        </tr>
							        					          
					  			</table>
					  			</s:if>
					  			</div>
					  		</td>
					  	</tr>		   
				    </table>
				    </div>		   
					</td>
				  </tr>
				</table>
			</td>
        </tr>
      </table>
    </div>
    </td>
  </tr>
</table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>